import { applyMiddleware, createStore } from "redux"
import { reducer } from "./reducer"
// 导入日志打印中间件
import logger from "redux-logger"
import { persistStore, persistReducer } from "redux-persist"
import storage from 'redux-persist/lib/storage'
var persistedReducer = persistReducer({ key: 'Reduxs', storage }, reducer)
// 实例化store导出
export var store = createStore(persistedReducer, applyMiddleware(logger))
export var persitor = persistStore(store)